/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.produccion.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author carlosdavid
 */
@Entity
@Table(name = "ccosto", catalog = "base_prod", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Ccosto.findAll", query = "SELECT c FROM Ccosto c"),
    @NamedQuery(name = "Ccosto.findByIdcCosto", query = "SELECT c FROM Ccosto c WHERE c.idcCosto = :idcCosto"),
    @NamedQuery(name = "Ccosto.findByDescripcion", query = "SELECT c FROM Ccosto c WHERE c.descripcion = :descripcion"),
    @NamedQuery(name = "Ccosto.findByIdUsuario", query = "SELECT c FROM Ccosto c WHERE c.idUsuario = :idUsuario"),
    @NamedQuery(name = "Ccosto.findByFecha", query = "SELECT c FROM Ccosto c WHERE c.fecha = :fecha"),
    @NamedQuery(name = "Ccosto.findByFechaMod", query = "SELECT c FROM Ccosto c WHERE c.fechaMod = :fechaMod")})
public class Ccosto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idcCosto", nullable = false, length = 5)
    private String idcCosto;
    @Column(name = "descripcion", length = 255)
    private String descripcion;
    @Column(name = "idUsuario", length = 15)
    private String idUsuario;
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @Column(name = "fechaMod")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaMod;

    public Ccosto() {
    }

    public Ccosto(String idcCosto) {
        this.idcCosto = idcCosto;
    }

    public String getIdcCosto() {
        return idcCosto;
    }

    public void setIdcCosto(String idcCosto) {
        this.idcCosto = idcCosto;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getIdUsuario() {
        return idUsuario;
    }

    public void setIdUsuario(String idUsuario) {
        this.idUsuario = idUsuario;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Date getFechaMod() {
        return fechaMod;
    }

    public void setFechaMod(Date fechaMod) {
        this.fechaMod = fechaMod;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcCosto != null ? idcCosto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ccosto)) {
            return false;
        }
        Ccosto other = (Ccosto) object;
        if ((this.idcCosto == null && other.idcCosto != null) || (this.idcCosto != null && !this.idcCosto.equals(other.idcCosto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.produccion.entity.Ccosto[ idcCosto=" + idcCosto + " ]";
    }
    
}
